package homework_4_minesweeper;

import javax.swing.*;
import java.awt.event.ActionListener;

public class NorthMenu extends JMenuBar{
    private static JMenu newGame=new JMenu("新游戏");
    private static JMenu reset=new JMenu("重新开始");
    private static JMenu exit=new JMenu("退出");
    private static JMenuItem exitChoice=new JMenuItem("退出");
    private static JMenuItem newGameEasy=new JMenuItem("初级");
    private static JMenuItem newGameIntermediate=new JMenuItem("中级");
    private static JMenuItem newGameDifficult=new JMenuItem("高级");
    private static JMenuItem resetAll=new JMenuItem("开始新的一局");
    private static JMenuItem resetThis=new JMenuItem("重新开始本局");
    public NorthMenu(ActionListener actionListener){
        this.add(newGame);
        this.add(reset);
        this.add(exit);
        newGame.add(newGameEasy);
        newGame.add(newGameIntermediate);
        newGame.add(newGameDifficult);
        reset.add(resetAll);
        reset.add(resetThis);
        exit.add(exitChoice);
        exitChoice.addActionListener(actionListener);
        resetAll.addActionListener(actionListener);
        resetThis.addActionListener(actionListener);
        newGameEasy.addActionListener(actionListener);
        newGameIntermediate.addActionListener(actionListener);
        newGameDifficult.addActionListener(actionListener);
    }
    public static JMenuItem getNewGameEasy(){
        return newGameEasy;
    }
    public static JMenuItem getNewGameIntermediate(){
        return newGameIntermediate;
    }
    public static JMenuItem getNewGameDifficult() {
        return newGameDifficult;
    }
    public static JMenuItem getExitChoice() {
        return exitChoice;
    }
    public static JMenuItem getResetAll() {
        return resetAll;
    }
    public static JMenuItem getResetThis() {
        return resetThis;
    }
}
